<template>
  <div class="content">
    <!-- the Nvar -->
    <van-sticky>
      <!-- <van-nav-bar title="主页" /> -->
    </van-sticky>

    <div style="flex: 1; overflow: auto;">
      <main-page v-show="activeIndex == 1"></main-page>
      <person-center v-show="activeIndex == 2"></person-center>
    </div>

    <!-- footer Navigation  -->
    <div class="foot-navigat">
      <div :class="[this.activeIndex == 1 ? 'active-sty' : '']" @click="activeIndex = 1">
        <i class="iconfont icon-zhuye"></i>
        <span>主页</span>
      </div>
      <div :class="[this.activeIndex == 2 ? 'active-sty' : '']" @click="activeIndex = 2">
        <i class="iconfont icon-gerenzhongxin"></i>
        <span>个人中心</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Home",
  components: {
    MainPage: () => import("./components/mainPage"),
    PersonCenter: () => import("./components/personCenter"),
  },
  data() {
    return {
      current: 0,
      activeIndex: 1,
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
    toRouter(router) {
      this.$router.push({
        path: router,
      });
    },
  },
};
</script>

<style lang="less" scoped>
.content {
  width: 100vw;
  // min-height: 100vh;
  height: 100vh;
  background-color: #f2f2f2;
  display: flex;
  flex-direction: column;
  .clomn-style {
    display: flex;
    flex-direction: column;
    background-color: #f2f2f2;
    //   height: 50vh;
    .row-style {
      display: flex;
      justify-content: flex-start;
      background-color: #ffffff;
      // align-content: flex-start;
      flex-wrap: wrap;
      margin-bottom: 2vh;
      .home-layout {
        display: flex;
        width: 33.3333%;
        flex-direction: column;
        align-items: center;
        // flex: 33.33333%;
        margin: 10px 0;
        & div {
          text-align: center;
        }
        & span {
          display: block;
          margin-top: 10px;
          font-size: 0.8rem;
        }
        .icon-style {
          border-radius: 50%;
          height: 50px;
          width: 50px;
          background-color: #ffffff;
          border: 1px solid #07c160;
        }
      }
    }
  }
  .custom-indicator {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
  }
  & .scansell-img {
    width: 100vw;
    height: 30vh;
  }
  .foot-navigat {
    // position: absolute;
    // bottom: 0;
    // width: 100vw;

    height: 60px;
    border-top: 1px solid #ffffff;
    background-color: #409eff;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #ffffff;
    font-size: 15px;
    .active-sty {
      color: #f56c6c;
      font-weight: 800;
    }
    & > div {
      display: flex;
      flex-direction: column;
      align-items: center;
      & > i {
        font-size: 23px;
      }
    }
  }
}
</style>
